--[[
 -- *名称:EnterRoomLayer
 -- *描述:[XXXXXXXXX]
 -- *版权:Copyright © 2016-2018 深圳市三只小熊科技有限公司 版权所有
 -- *作者:Administrator
 -- *创建日期:2017-10-31
 -- *修改日期:2017-10-31
 ]]

local EnterRoomLayer = class("EnterRoomLayer", PokerViewBase)
local CURRENT_MODULE_NAME = ...
--[[
	界面处理需要保证就算是错误数据也做到不崩溃
	在获取到数据的时候进行checkData操作
]]
function EnterRoomLayer:onCreate()
	-- body 
	self:addMask()
	self:initWithFilePath("enterroomlayer",CURRENT_MODULE_NAME, true)

	local scale = display.width / 1280;
	self.node.bg:setScale(scale);
	self.node.im_board:setTouchEnabled(false); 
	for i=1,4 do
      self.node["im_"..i]:setTouchEnabled(false); 
	end
	AnimUtils.playPopupAnim(self.node.bg);
end

for i=0,9 do
	EnterRoomLayer["NumClick" .. i] = function(self)
		-- body
		self.part:appendNumber(i)
	end
end

function EnterRoomLayer:AddGameClick()    
	self.part:requestEnterRoomClick();
end

function EnterRoomLayer:DelClick()    
	self.part:deleteNumber();
end

function EnterRoomLayer:CloseClick()
	SoundMgr.ClickButton();
	self.part:deactivate()
end

function EnterRoomLayer:ResetClick( ... )
	self.part:clearRoomId()
end

function EnterRoomLayer:showNum(strTable)
	local str = table.concat(strTable);
	self.node.txt_roomid:setString(str);

	if #strTable >= 6 then

		self.part:requestEnterRoomClick();
	end
end

function EnterRoomLayer:CreateGameClick()
	self.part:createGameClick()
end

return EnterRoomLayer